package com.sunwayhorizo.health.ets.base.persistent;

import java.io.Serializable;

import java.sql.Timestamp;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.TableGenerator;

@Entity
@TableGenerator(name = "Conceptlist_IdGenerator", table = "ET_Id_Generator", pkColumnName = "pkColumn", valueColumnName = "valueColumn", pkColumnValue = "Conceptlist_Id")
@NamedQuery(name = "EtConceptlists.findAll", query = "select o from EtConceptlists o")
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@Table(name = "ET_CONCEPTLISTS")
public class EtConceptlists implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.TABLE, generator = "Conceptlist_IdGenerator")
	@Column(name = "CONCEPTLIST_ID", nullable = false)
	private String conceptlistId;

	@Column(name = "CONCEPTLIST_DESC")
	private String conceptlistDesc;
	
	@Column(name = "CONCEPTLIST_NAME", nullable = false)
	private String conceptlistName;
	
	@Column(name = "EXTENSIBILITY_CODE", nullable = false)
	private String extensibilityCode;
	
	@Column(name = "GROUP_NAME", nullable = false)
	private String groupName;
	
	@Column(name = "INHERITANCE_ADD_FLAG", nullable = false)
	private String inheritanceAddFlag;
	
	@Column(name = "INHERITANCE_SUB_FLAG", nullable = false)
	private String inheritanceSubFlag;
	
	@Column(name = "RESTRICTED_FLAG", nullable = false)
	private String restrictedFlag;
	
	@Column(name = "STATUS_FLAG", nullable = false)
	private String statusFlag;
	
	@Column(name = "USAGE_CONTEXT_ID")
	private String usageContextId;

	@Column(name = "CREATION_DATE", nullable = false)
	private Timestamp creationDate;
	
	@Column(name = "CREATED_BY", nullable = false)
	private Long createdBy;
	
	@Column(name = "LAST_UPDATE_DATE", nullable = false)
	private Timestamp lastUpdateDate;
	
	@Column(name = "LAST_UPDATED_BY", nullable = false)
	private Long lastUpdatedBy;
	
	@Column(name = "LAST_UPDATE_LOGIN")
	private Long lastUpdateLogin;

	@OneToMany(mappedBy = "etConceptlists")
	private List<EtCncptlistAssgns> etCncptlistAssgnsList = new ArrayList<EtCncptlistAssgns>();
	
	@OneToMany(mappedBy = "etConceptlists")
	private List<EtConceptlists> etConceptlistsList = new ArrayList<EtConceptlists>();

	@ManyToOne
	@JoinColumn(name = "PARENT_ID")
	private EtConceptlists etConceptlists;

	public EtConceptlists() {
		Long i = new Long(1);
		Timestamp nowTime = new Timestamp(new Date().getTime());

		createdBy = i;
		creationDate = nowTime;
		lastUpdatedBy = i;
		lastUpdateDate = nowTime;
		lastUpdateLogin = i;
	}

	public String getConceptlistDesc() {
		return conceptlistDesc;
	}

	public void setConceptlistDesc(String conceptlistDesc) {
		this.conceptlistDesc = conceptlistDesc;
	}

	public String getConceptlistId() {
		return conceptlistId;
	}

	public void setConceptlistId(String conceptlistId) {
		this.conceptlistId = conceptlistId;
	}

	public String getConceptlistName() {
		return conceptlistName;
	}

	public void setConceptlistName(String conceptlistName) {
		this.conceptlistName = conceptlistName;
	}

	public Long getCreatedBy() {
		return createdBy;
	}

	public void setCreatedBy(Long createdBy) {
		this.createdBy = createdBy;
	}

	public Timestamp getCreationDate() {
		return creationDate;
	}

	public void setCreationDate(Timestamp creationDate) {
		this.creationDate = creationDate;
	}

	public String getExtensibilityCode() {
		return extensibilityCode;
	}

	public void setExtensibilityCode(String extensibilityCode) {
		this.extensibilityCode = extensibilityCode;
	}

	public String getGroupName() {
		return groupName;
	}

	public void setGroupName(String groupName) {
		this.groupName = groupName;
	}

	public String getInheritanceAddFlag() {
		return inheritanceAddFlag;
	}

	public void setInheritanceAddFlag(String inheritanceAddFlag) {
		this.inheritanceAddFlag = inheritanceAddFlag;
	}

	public String getInheritanceSubFlag() {
		return inheritanceSubFlag;
	}

	public void setInheritanceSubFlag(String inheritanceSubFlag) {
		this.inheritanceSubFlag = inheritanceSubFlag;
	}

	public Long getLastUpdatedBy() {
		return lastUpdatedBy;
	}

	public void setLastUpdatedBy(Long lastUpdatedBy) {
		this.lastUpdatedBy = lastUpdatedBy;
	}

	public Timestamp getLastUpdateDate() {
		return lastUpdateDate;
	}

	public void setLastUpdateDate(Timestamp lastUpdateDate) {
		this.lastUpdateDate = lastUpdateDate;
	}

	public Long getLastUpdateLogin() {
		return lastUpdateLogin;
	}

	public void setLastUpdateLogin(Long lastUpdateLogin) {
		this.lastUpdateLogin = lastUpdateLogin;
	}

	public String getRestrictedFlag() {
		return restrictedFlag;
	}

	public void setRestrictedFlag(String restrictedFlag) {
		this.restrictedFlag = restrictedFlag;
	}

	public String getStatusFlag() {
		return statusFlag;
	}

	public void setStatusFlag(String statusFlag) {
		this.statusFlag = statusFlag;
	}

	public String getUsageContextId() {
		return usageContextId;
	}

	public void setUsageContextId(String usageContextId) {
		this.usageContextId = usageContextId;
	}

	public List<EtCncptlistAssgns> getEtCncptlistAssgnsList() {
		return etCncptlistAssgnsList;
	}

	public void setEtCncptlistAssgnsList(
			List<EtCncptlistAssgns> etCncptlistAssgnsList) {
		this.etCncptlistAssgnsList = etCncptlistAssgnsList;
	}

	public EtCncptlistAssgns addEtCncptlistAssgns(
			EtCncptlistAssgns etCncptlistAssgns) {
		getEtCncptlistAssgnsList().add(etCncptlistAssgns);
		etCncptlistAssgns.setEtConceptlists(this);
		return etCncptlistAssgns;
	}

	public EtCncptlistAssgns removeEtCncptlistAssgns(
			EtCncptlistAssgns etCncptlistAssgns) {
		getEtCncptlistAssgnsList().remove(etCncptlistAssgns);
		etCncptlistAssgns.setEtConceptlists(null);
		return etCncptlistAssgns;
	}

	public EtConceptlists getEtConceptlists() {
		return etConceptlists;
	}

	public void setEtConceptlists(EtConceptlists etConceptlists) {
		this.etConceptlists = etConceptlists;
	}

	public List<EtConceptlists> getEtConceptlistsList() {
		return etConceptlistsList;
	}

	public void setEtConceptlistsList(List<EtConceptlists> etConceptlistsList) {
		this.etConceptlistsList = etConceptlistsList;
	}

	public EtConceptlists addEtConceptlists(EtConceptlists etConceptlists) {
		getEtConceptlistsList().add(etConceptlists);
		etConceptlists.setEtConceptlists(this);
		return etConceptlists;
	}

	public EtConceptlists removeEtConceptlists(EtConceptlists etConceptlists) {
		getEtConceptlistsList().remove(etConceptlists);
		etConceptlists.setEtConceptlists(null);
		return etConceptlists;
	}
}
